<template>
    <div>
        <van-cell-group>
            <van-field v-model="mobile" label="手机号" placeholder="请输入手机号" />
            <div style="margin: 16px;">
                <van-button @click="bindmobile" type="primary">绑定</van-button>
            </div>
        </van-cell-group>
    </div>
</template>

<script>
export default {
    data(){
        return{
            mobile:'',
        }
    },
    methods:{
        bindmobile(){
            var data = {"mobile":this.mobile,"uid":this.$route.query.uid,"token":this.$route.query.token}
            this.axios.post("user/bindMobile",data).then(res=>{
                var data = res.data
                var userid = data.userid
                var token = data.token
                localStorage.setItem("userid",userid)
                localStorage.setItem("token",token)
                window.location.href='http://localhost:8080/#/login'
            })
        }
    }
}
</script>

<style>

</style>